<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html;	charset=UTF-8">
		<title>新闻列表示例</title>
		<link type="text/css" rel="stylesheet"
			href="ext/resources/css/ext-all.css" />
		<script type="text/javascript" src="ext/ext-base.js">
</script>
		<script type="text/javascript" src="ext/ext-all.js">
</script>
		<script type="text/javascript" src="ext/ext-lang-zh_CN.js">
</script>

		<script type="text/javascript">

Ext.onReady(function (){

		//开启表单提示
		Ext.QuickTips.init();
		Ext.form.Field.prototype.msgTarget = 'side';  
			//首先做表单面板
			var	fg=new Ext.form.FormPanel({
			
			id:"login-form",
			bodyStyle : 'padding-top:30px',
			
			labelWidth:50,
			labelAlign:'right',
			buttonAlign:'center',
			//表单跟窗体融合
			baseCls:'header',
			layout : 'form',
			defaults:{
			
				width:200
			},
			//默认类型
				defaultType: 'textfield',
				items:[{
				id:'numberOne',
				fieldLabel:'账号',
				allowBlank:false,
				blankText: '帐户不能为空'
			
			},
			{
			
				id:'numberTwo',
				fieldLabel:	'密码',
				allowBlank:false,
				blankText: '密码不能为空'
			
			}],
			
			buttons:[{
				text: '登陆',
				type: 'submit',
				handler:function(){
				
				Ext.getCmp('login-form').getForm().submit({
				
				url:'/striptes/actions/Login.action',
				method:"POST"	,
				success : function(form, action) {   
				
							               Ext.Msg.alert('登陆成功', action.result.success);  
			                            
			       }
				
				
				
				
				
					}		);	}
			
			},
			{
			text:'注册',
			type:'button',
			handler:link
			
			
			},
			
			{
			
			text:"取消",
			handler:function(){fg.form.reset();}
			
			}]


});


//其次做窗体
var	win=new	Ext.Window({
id:"login-win",
title:"登陆",
iconCls:"tabs",
width:300,
height:200,
// 表示可以折叠
collapsible	: true ,
//里面颜色是否跟边框一致
plain :	true,
//填充表单面板fg
items :[fg]

});

win.show();



});


 var  link= function  (){

document.location="Win.html";


};




</script>





	</head>
	<body>
		<div id="example_grid"></div>
  
	</body>
</html>
